﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using CXedu.Model;
using CXedu.Business;
using Ajeelee.Core.Utils;

namespace CXedu.WebSite
{
    public partial class index : System.Web.UI.Page
    {
        Hashtable table = new Hashtable();
        //焦点图片
        protected IList<PhotoImgs> photoImgsList = new List<PhotoImgs>();

        protected IList<News> gonggaolist = new List<News>();    // 最新公告
        protected IList<News> YSPXlist = new List<News>();       // 医师培训
        protected IList<News> ZGZSlist = new List<News>();       // 资质证书
        INewsBusiness newsBll = new NewsBusinessFactory().CreateNewsBusiness();
        IPhotoImgsBusiness photoBll = new PhotoImgsBusinessFactory().CreatePhotoImgsBusiness();

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //焦点图片
                table.Clear();
                table.Add(PhotoImgsHash.CId, 1);
                photoImgsList = photoBll.GetAllPhotoImgs(table);

                // 最新公告
                table.Clear();
                table.Add("TopNum", 6);
                table.Add(NewsHash.CId, 14);
                table.Add(NewsHash.OrderField, "InTime");
                table.Add(NewsHash.OrderDirection, "desc");
                gonggaolist = newsBll.GetAllNews(table);

                // 医师培训
                table.Clear();
                table.Add("TopNum", 10);
                table.Add(NewsHash.CustomWhere, "(N_CId in (16,17,18,19))");
                table.Add(NewsHash.OrderField, "InTime");
                table.Add(NewsHash.OrderDirection, "desc");
                YSPXlist = newsBll.GetAllNews(table);

                // 药师培训
                table.Clear();
                table.Add("TopNum", 11);
                table.Add(NewsHash.CustomWhere, "(N_CId in (8,21,22))");
                table.Add(NewsHash.OrderField, "InTime");
                table.Add(NewsHash.OrderDirection, "desc");
                ZGZSlist = newsBll.GetAllNews(table);
            }
            catch (System.Threading.ThreadAbortException ex) { }
            catch (Exception ex)
            {
                Function.WriteErrorLog(ex);
            }
        }
    }
}